var PlanItem = function(sup){
	
	var planData = {result:[{startDate:'2010-01-20 17:12:10',
							 endDate:'2010-01-20 18:20:10',
							 content:'计划DEMO'}]};
	
	var planStore = new Ext.data.JsonStore({
		data : planData,
		root : 'result',
		fields : ['startDate','endDate','content']
	});
	
	var planGrid = new Ext.grid.GridPanel({
		height : 150,
		store : planStore,
		tbar : [{xtype:'button',text:'新增'},
		        {xtype:'button',text:'删除'}],
		columns : [{header:'开始时间',dataIndex:'startDate'},
		           {header:'结束时间',dataIndex:'endDate'},
		           {header:'计划内容',dataIndex:'content'}],
		listeners : {
		rowcontextmenu : function(grid, rowIndex, e) {
			var store = grid.store;
			var rec = store.getAt(rowIndex);
			var data = rec.data;
			e.preventDefault();
			if (rowIndex < 0) {
				return;
			}
			var treeMenu = new Ext.menu.Menu(
					{
						items : [
								{
									text : "执行人",
									icon : "images/lock_delete.png",
									scope : this,
									handler : function() {}
								},
								{
									text : "删除",
									icon : "images/lock_open.png",
									scope : this,
									handler : function() {}
								}]
					});
			treeMenu.showAt(e.getPoint());
		}
		}
	});
	
	this.itemWin = new Ext.Window({
		title : '计划子项',
		modal : true,
		width : 600,
		resizabled : false,
		items : [planGrid],
		buttons : [{text:'上一步',
			scope : this,
			handler:function(){
				this.itemWin.hide();
				sup.win.show();
			}},{text:'生成计划',
				scope : this,
				handler:function(){
					alert('生成计划');
				}}]
	});
};